package chatBot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;

@TableName(value = "user")
@ApiModel(description = "用户实体")
@Entity

public class User implements Serializable {
    @Id
    @Column(name = "userId", nullable = false)
    @TableId(type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "用户ID", example = "1234567890123456789")
    private Long userId;

    @ApiModelProperty(value = "用户名", example = "JohnDoe")
    private String userName;

    @ApiModelProperty(value = "用户邮箱", example = "1380013800@qq.com")
    private String userEmail;

    @ApiModelProperty(value = "用户密码", example = "password123")
    private String userPassword;

    @ApiModelProperty(value = "用户Token数量", example = "10")
    private Integer userTokenCount;

    @ApiModelProperty(value = "微信用户id")
    private String openId;

    @ApiModelProperty(value = "登录状态")
    //0表示下线；1表示上线
    private Integer state;

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", userName='" + userName + '\'' +
                ", userEmail='" + userEmail + '\'' +
                ", userPassword='" + userPassword + '\'' +
                ", userTokenCount=" + userTokenCount +
                ", openId='" + openId + '\'' +
                ", state=" + state +
                '}';
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserEmail() {
        return userEmail;
    }

    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail;
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    public Integer getUserTokenCount() {
        return userTokenCount;
    }

    public void setUserTokenCount(Integer userTokenCount) {
        this.userTokenCount = userTokenCount;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

}
